-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ENH][wal3] CPU parts of garbage collection #4617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Initial Implementation of Garbage Collection Algorithm in wal3 (CPU-side, Non-IO Path) This PR introduces the core CPU-side algorithm and data structures for garbage collection (GC) in the Rust wal3 write-ahead log (WAL) library. It defines the Key Changes: Affected Areas: Potential Impact: Functionality: Adds foundational, rigorously tested manifest/snapshot GC algorithmic support for the WAL, but does not yet delete files from object storage. Manifests now track collected garbage and enable end-to-end garbage collection state transitions and verification. Performance: Limited immediate impact; actual I/O batching/deletion and any performance changes will come when I/O is wired in. CPU-only logic is property tested and should be efficient. Security: No sensitive changes, but integrity checks and error handling are enhanced-setsum mismatches and partial collection are detected and explicitly handled. Scalability: Prepares codebase for efficient, incremental GC even on large logs by supporting manifest-level tracking, batched GC, and partial manifest application. Review Focus: Testing Needed• Run the new property-based tests (cargo test) to verify Code Quality Assessmentrust/wal3/src/gc.rs: Well-structured, idiomatic Rust; explicitly handles setsum integrity, recursion, and error reporting. No critical dead code or TODOs in the final version. rust/wal3/src/manifest.rs: Cleanly extended to support new GC-related fields and logic without breaking compatibility. rust/wal3/tests/properties.rs: Robust usage of proptest with clear scenarios testing the GC lifecycle and setsum correctness. rust/wal3/README.md: Updated with accurate, detailed documentation on GC mechanics and contract. Best PracticesState Integrity: Documentation: Serialization: Testing: Error Handling: Potential Issues• Future IO integration is outstanding-actual removal from object storage is not yet implemented. This summary was automatically generated by @propel-code-bot |
rust/wal3/src/gc.rs
Outdated
&mut Setsum::default(), | ||
)?); | ||
} | ||
todo!(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[CriticalError]
There's an unimplemented function in gc.rs
that will cause runtime failures. The drop_snapshot
method on line 105 ends with a todo!()
macro, which will panic when called. This needs to be implemented before this code can be safely merged.
This PR documents what the GC.XXX file looks like and its structures. This doesn't implement GC for wal3 yet, just lays out what it'll look like.
Description of changes
This PR lays out the basics of garbage collection and the algorithm to use.
What remains to be done:
Test plan
CI
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes